import { createWebHashHistory, createRouter } from 'vue-router'

const routes = [
  {
    path: '/order',
    component: () => import('../views/layout/index.vue'),
    children: [

      {
        path: 'erp',
        component: () => import('../views/erp/index.vue'),
        children: [
          { path: '', redirect: '/order/erp/fabricStore' },
          {
            path: 'fabricStore',
            component: () => import('../views/erp/fabric/store.vue'),
          },
          {
            path: 'fabricOutbound',
            component: () => import('../views/erp/fabric/outbound.vue'),
          },
          {
            path: 'fabricInventory',
            component: () => import('../views/erp/fabric/inventory.vue'),
          },
          {
            path: 'auxiliaryStore',
            component: () => import('../views/erp/auxiliary/store.vue'),
          },
          {
            path: 'auxiliaryOutbound',
            component: () => import('../views/erp/auxiliary/outbound.vue'),
          },
          {
            path: 'auxiliaryInventory',
            component: () => import('../views/erp/auxiliary/inventory.vue'),
          },
        ]
      }
    ]
  },
  { path: '/', redirect: '/order/erp' }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})
export default router